import {mapActions, mapGetters} from "vuex"
export const mixins = {
    props: ["item", "index", "activeIndex", "isBreakLos", "questionIndex"],
    computed: {
        //背景图
        contentStyle() {
            return {
                background: "url(" + this.item.background + ")0 0/100% 100%",
            }
        },
        //元素属性
        articleStyle(item) {
            return function (item) {
                return {
                    position: "absolute",
                    background: "url(" + item.imageUrl + ")0 0/100% 100%",
                    width: item.width,
                    height: item.height,
                    left: item.left,
                    top: item.top,
                    zIndex: item.isFront ? 99 : 98
                }
            }
        },
        isAssignmentFinish() {
            return this.item.isFinish && this.isSeedEntery
        },
        ...mapGetters("seedActivityStatus", {
            isSeedEntery: "getIsSeedEntery",
        })
    },
    methods: {
        breakLosTouch: function () {
            this.$emit('losShow')
        },
        ...mapActions("assignmentStatus", ["updateAssignmentFinish", "updateOperated", "setQuestionAudio", "setFireworkPlay", "setSucLottiePlay"])
    },
    watch: {
        isAssignmentFinish: function (bool) {
           setTimeout(()=>{
               this.$emit("nextAssignment")
           },1000)
        }
    }
}
